package fr.miage.ageco.dataaccess.mappers;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import fr.miage.ageco.dataaccess.bo.Employe;

public interface EmployeMapper {

	@Select("SELECT * FROM Employe")
	List<Employe> getAllEmployes();

	@Select("SELECT * FROM Employe WHERE  id = #{id}")
	Employe getEmploye(@Param("id") Integer id);

	@Insert("INSERT INTO Employe (id, nom, prenom, naissance, email, fonction, agence, etp) VALUES (#{id},#{nom},#{prenom},#{naissance},#{email},#{fonction},#{agence},#{etp})")
	public int addCompetence(Employe employe);
	
	@Insert("INSERT INTO Employe (id, nom, prenom, naissance, email, fonction, agence, etp) VALUES (#{id},#{nom},#{prenom},#{naissance},#{email},#{fonction},#{agence},#{etp})")
	public int insertEmploye(Employe employe);

	@Update("UPDATE Employe SET nom = #{nom}, prenom = #{prenom}, naissance = #{naissance}, email = #{email}, fonction = #{fonction}, agence = #{agence} WHERE id = #{id}")
	public int updateEmploye(Employe employe);
	
	@Delete("DELETE FROM Employe WHERE id = #{id}")
	public int deleteEmploye(Employe employe);
	
}
